package com.cx.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
//未加载到springmvc
@Configuration
public class Springmvcsupport extends WebMvcConfigurationSupport {
    @Autowired
    private controllerinterceptor controllerinterceptor;
    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("/page/*").addResourceLocations("/page/");
//        registry.addResourceHandler("/index.jsp").addResourceLocations("/index.jsp");
//        registry.addResourceHandler("/gouwuche.jsp").addResourceLocations("/gouwuche.jsp");
    }

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(controllerinterceptor).addPathPatterns("/index/*");
    }
}
